package cn.tedu.spring2205.week02.beans;

import org.springframework.stereotype.Service;

import javax.annotation.Resource;

@Service
public class AccountService {
    //注入AccountDao实例

    //构造方法注入,@Resource不适用
//    @Resource
//    public AccountService(AccountDao accountDao){
//    }

    private AccountDao accountDao;

    @Resource
    private CustomDao dao;

    //set方法注入
    @Resource
    public void setAccountDao(AccountDao dao){
        this.accountDao = dao;
    }

    //get方法用户获取accountDao是否注入了Bean对象
    public AccountDao getAccountDao(){
        return this.accountDao;
    }

    public CustomDao getCustomDao(){
        return this.dao;
    }
}
